package com.zcsy.commons.exception;

import javax.servlet.http.HttpServletRequest;

/**  
 * @Project: common
 * @Title: RunningException.java
 * @Package com.zcsy.commons.exception
 * @Description: 运行抛出的异常
 *
 * @author xiangjw 303310059@qq.com
 * @date 2016年1月12日 下午12:48:47
 * @Copyright: 2016 武汉中财数元信息技术有限公司 All rights reserved.
 * @version V1.0  
 */
public class RunningException extends Exception {
	public String code;

	public RunningException(String code , String message) {
		super(message);
		this.code = code;
	}
	
	/** 
	 * @Title: throwEx 
	 * @Description: 手动抛异常到页面上（带错误码）
	 * @param @param code 错误码
	 * @param @param message 消息
	 * @param @param req
	 * @param @throws Exception     
	 * @return void     
	 * @throws 
	 */
	public static void throwEx(String code ,String message , HttpServletRequest req) throws Exception{
		RunningException ex = new RunningException(code, message);
		req.setAttribute("Exception", ex);
		throw ex;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	
}
